package com.axend.aerosense.common.util;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;


import com.axend.aerosense.common.ui.WebActivity;

public class WebUtil {
    /**
     * 打开Webview
     * @param activity
     * @param titileResId
     */
    public static void openWebView(Context activity, String url, int titileResId){
        Intent intent = new Intent(activity, WebActivity.class);
        intent.putExtra(WebActivity.URL, url);
        intent.putExtra(WebActivity.TITLE, activity.getString(titileResId));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        activity.startActivity(intent);
    }


    /**
     * 打开Webview
     * @param activity
     * @param titile
     */
    public static void openWebView(Context activity, String url, String titile){
        Intent intent = new Intent(activity, WebActivity.class);
        intent.putExtra(WebActivity.URL, url);
        intent.putExtra(WebActivity.TITLE, titile);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        activity.startActivity(intent);
    }
}
